
OBJS = main.o array_test.o std_test.o indirect_list.o sort_test.o

TESTS = main
 
TLIB = libgtest.a

GALL = gtest-all.o

GMAIN = gtest_main.o

GTEST_SRC = ${GTEST_DIR}/src

CXXFLAGS += -g -Wall -W

$(TESTS):  $(OBJS) $(TLIB)
	$(CXX) $(CXXFLAGS) -lpthread $^ -o $@

$(TLIB): $(GALL) $(GMAIN)
	$(AR) $(ARFLAGS) $@ $^

$(GALL) : $(GTEST_SRC)/gtest-all.cc
	$(CXX) $(CXXFLAGS) -I${GTEST_DIR}/include -I${GTEST_DIR} -c $^

$(GMAIN) : $(GTEST_SRC)/gtest_main.cc
	$(CXX) $(CXXFLAGS) -I${GTEST_DIR}/include -I${GTEST_DIR} -c $^

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -I${GTEST_DIR}/include -c $^

clean:
	rm -f $(OBJS) $(TESTS)
test:
	./main --gtest_filter=sort.quick
